<template>
    <div class="evaluation">
        <van-nav-bar
                title="评价"
                left-arrow
                @click-left="onClickLeft"
        />

        <div style="width: 100%;background-color:#fff;padding: 10px 20px;border-bottom: 1px solid #f2f2f2" v-for="(v,k) in evaluation.list" :key="y" >
            <div style="width: 100%; height: 40px;display: flex">
                <img style="width: 40px;height: 40px;border-radius: 50%;"
                     :src="v.userInfo.avatarUrl ? v.userInfo.avatarUrl : 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2441479199,3701248645&fm=26&gp=0.jpg'">
                <div style="margin-left:10px;display: flex;flex-direction: column;justify-content: space-around">
                    <span style="font-size: 13px">{{v.userInfo.nickName}}</span>
                    <van-rate v-model="v.star" readonly color="red"/>
                </div>
            </div>
            <div style="padding: 10px 0;line-height: 22px;font-size: 14px;color: #333333">
                <p>{{ v.content }}</p>
                <van-row gutter="5" style="margin-top: 10px" v-if="v.img">
                    <van-col span="8" v-for="(v,k) in 5">
                        <img :src="v.img"
                             width="100%">
                    </van-col>
                </van-row>
            </div>
            <div style="color: #999999;font-size: 12px">{{ v.skuid }}</div>
        </div>

        <!--        <img src="./1.png" alt="" width="100%">-->
    </div>
</template>

<script>

    import {CommentList} from '@/api/api';

    export default {
        name: "evaluation",
        data() {
            return {
                evaluation: []//评价
            }
        },
        created() {
            this.List(this.$route.query.goodId)//评价
        },
        methods: {
            onClickLeft() {
                this.$router.go(-1)
            },
            List(goodId) {
                //评论
                CommentList({
                    type: 0,
                    valueId: goodId,
                    showType: 0,
                    page: 1,
                    limit: 2
                }).then(res => {
                    this.evaluation = res.data.data
                })
            }
        }
    }
</script>

<style scoped>
    .evaluation {
        background-color: #fff;
    }
</style>
